<template>
  <div>
    <el-form ref="heatmapSetting" :model="setting" label-position="top">
      <el-form-item label="Show Grouping Bar">
        <el-switch v-model="setting.showGroupingBar"></el-switch>
      </el-form-item>
      <el-form-item label="Collapse Fields">
        <el-switch v-model="setting.expandAll"></el-switch>
      </el-form-item>
      <el-form-item label="For Empty Cells Show Zero">
        <el-switch v-model="setting.isEmptyCellsTextContent"></el-switch>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>

export default {
  name: 'pvtable-setting',
  components: { },
  data () {
    return {
      setting: {
        showToolbar: true,
        showGroupingBar: true,
        expandAll: false,
        isEmptyCellsTextContent:true
      },
    }
  },
  props: [
    'data', 'fieldsList'
  ],
  watch: {
    data (value, oldValue) {
      return this.updateSetting(value)
    },
 
  },
  created () {
    if (this.data) {
      this.$set(this.data)
    }
  },
  methods: {
    getData () {
      return this.setting
    },
    updateSetting (value, list, layerStatus) {
      this._.merge(this.setting, value.gadgetSetting)
      this.$emit('update:data', this.setting)
    }

  }
}
</script>

<style lang="scss">
.line-setting {

}

</style>
